# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BackupDR.V1.Model.BackupPlanAssociation do
  @moduledoc """
  A BackupPlanAssociation represents a single BackupPlanAssociation which contains details like workload, backup plan etc

  ## Attributes

  *   `backupPlan` (*type:* `String.t`, *default:* `nil`) - Required. Resource name of backup plan which needs to be applied on workload. Format: projects/{project}/locations/{location}/backupPlans/{backupPlanId}
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the instance was created.
  *   `dataSource` (*type:* `String.t`, *default:* `nil`) - Output only. Output Only. Resource name of data source which will be used as storage location for backups taken. Format : projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. The resource name of BackupPlanAssociation in below format Format : projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}
  *   `resource` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. Resource name of workload on which backupplan is applied
  *   `resourceType` (*type:* `String.t`, *default:* `nil`) - Optional. Required. Resource type of workload on which backupplan is applied
  *   `rulesConfigInfo` (*type:* `list(GoogleApi.BackupDR.V1.Model.RuleConfigInfo.t)`, *default:* `nil`) - Output only. The config info related to backup rules.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The BackupPlanAssociation resource state.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the instance was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :backupPlan => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :dataSource => String.t() | nil,
          :name => String.t() | nil,
          :resource => String.t() | nil,
          :resourceType => String.t() | nil,
          :rulesConfigInfo => list(GoogleApi.BackupDR.V1.Model.RuleConfigInfo.t()) | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:backupPlan)
  field(:createTime, as: DateTime)
  field(:dataSource)
  field(:name)
  field(:resource)
  field(:resourceType)
  field(:rulesConfigInfo, as: GoogleApi.BackupDR.V1.Model.RuleConfigInfo, type: :list)
  field(:state)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.BackupDR.V1.Model.BackupPlanAssociation do
  def decode(value, options) do
    GoogleApi.BackupDR.V1.Model.BackupPlanAssociation.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BackupDR.V1.Model.BackupPlanAssociation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
